<template>
  <div class="container">
    <myHeader @sendSearch="search" />
    <TabList />
    <div class="content">
      <router-view v-slot="{ Component }" :search-content="searchContent">
        <transition name="move" mode="out-in">
          <keep-alive>
            <component :is="Component" />
          </keep-alive>
        </transition>
      </router-view>
    </div>
    <Footer />
  </div>
</template>

<script>
import myHeader from '@/components/layout/Header';
import TabList from '@/components/layout/TabList';
import Footer from '@/components/layout/Footer';
export default {
  name: 'Container',
  components: {
    myHeader,
    TabList,
    Footer
  },
  data() {
    return {
      searchContent: ''
    }
  },
  mounted() {
  },
  methods: {
    // 搜索事件
    search(searchContent) {
      this.searchContent = searchContent;
      if (this.$route.path === '/' || this.$route.path === '/home') {
        this.$router.push('/searchList');
      }
    }
  }
}
</script>

<style lang="less" scoped>
@aaa :192;
.container {
  width: 100%;
  height: 100%;
  background-color: #fff;
  box-sizing: border-box;
  overflow: auto;
  //filter: grayscale(1);
  .content {
    width: 100%;
    height: auto;
    margin-top: 8px;
    margin-bottom: 8px;
  }
}
</style>
